adding ethhdr type for linux/android for proper packet filtering.#4239
adding ethhdr type for linux/android for proper packet filtering.#4239devnexen wants to merge 1 commit intorust-lang:mainfrom
Conversation
|
Some changes occurred in the Android module cc @maurer |
55f537d to
d478bbb
Compare
da428da to
4f428e0
Compare
maurer
left a comment
There was a problem hiding this comment.
The main thing I see missing here is a use of ethhdr. A struct type with no usage by libc might not actually belong here, even though it is on the UAPI interface - this is a bindings crate for libc, not for the Linux kernel.
Is there a function in libc that you intend to call that uses the ethhdr struct? If so, layering on a commit binding that on top of this one would make a better PR IMO.
src/unix/linux_like/android/mod.rs
Outdated
|
|
||
| // linux/if_ether.h | ||
|
|
||
| #[repr(C, align(1))] |
There was a problem hiding this comment.
I know. was trying to solve few architectures build failures.
There is, for packet filters purpose. sendto/recvfrom can use any buffer e.g. ethhdr for this case. since AF_PACKET family and ETH_P* constants are already there, I m just trying to finish it off. |
9bb6cb5 to
a8ed135
Compare
930a40c to
9944b71
Compare
|
Since this is marked as a draft: @rustbot author (just update the labels if that isn't accurate) |
3c77dba to
7357526
Compare
|
This will need a rebase but I think it's ready for review so updating the labels @rustbot review |
tgross35
left a comment
There was a problem hiding this comment.
Sorry this fell off my radar. Just a few requests/questions
libc-test/build.rs
Outdated
| // FIXME: `h_proto` is of type __be16 big endian version of __u16 | ||
| (struct_ == "ethhdr" && field == "h_proto") || |
There was a problem hiding this comment.
What doesn't it like here? As far as I can tell, the __be16 type just gets the bitwise attribute which isn't picked up by GCC https://github.com/torvalds/linux/blob/e53642b87a4f4b03a8d7e5f8507fc3cd0c595ea6/include/uapi/linux/types.h#L27-L41.
There was a problem hiding this comment.
i forgot since, gonna try removing it
There was a problem hiding this comment.
I recall just now it was for some archs only.
There was a problem hiding this comment.
Could you paste the actual error here? I still don't understand how this could be failing.
There was a problem hiding this comment.
It happened only on CI but seems it does not happen anymore.
1fa2062 to
f92ae26
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
f69471d to
0019422
Compare
|
@rustbot ready |
6fc575c to
94f06b3
Compare
tgross35
left a comment
There was a problem hiding this comment.
Thanks for removing it. LGTM with a squash
74d9704 to
768cdd3
Compare
No description provided.